using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc.Filters;

namespace Admin3000.Backend.Api.Filters
{
    public class AllowCorsFilter : IActionFilter
    {

        public void OnActionExecuted(ActionExecutedContext context)
        {
            // throw new System.NotImplementedException();
            context.HttpContext.Response.Headers["Access-Control-Allow-Origin"]="*";
        }

        public void OnActionExecuting(ActionExecutingContext context)
        {
            context.HttpContext.Response.Headers["Access-Control-Allow-Origin"]="*";
        }
    }
}